package GUI;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.Color;
import java.awt.EventQueue;

import javax.swing.ImageIcon;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.SwingConstants;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import java.awt.Label;
import javax.swing.JScrollPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaPrincipal extends JFrame implements ActionListener {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	
	JPanel 		panel 				= new JPanel();
	//JPanel 		panel_1				= new JPanel();
	JPanel 		panel_2				= new JPanel();
	PanelInicial panel_1			=new PanelInicial();
	PanelEmpleado panel2			=new PanelEmpleado();
	JScrollPane scrollPane_1 		= new JScrollPane();
	JLabel 		label 				= new JLabel("");
	JLabel 		label2 				= new JLabel("");
	JMenuBar 	menuBar 			= new JMenuBar();
	JMenu 		mnConexion 			= new JMenu("Conexion");
	
	JMenuItem 	mntmConectarse 		= new JMenuItem("Conectarse");
	JMenu 		mnFacturacion 		= new JMenu("Facturacion");
	JMenu 		mnInformes 			= new JMenu("Informes");
	JSeparator 	separator 			= new JSeparator();
	JScrollPane scrollPane 			= new JScrollPane();
	
	/**
	 * Launch the application.
	 */
	


	
	public VentanaPrincipal() {
		
		setBounds(15, 15, 850, 625);
		
		getContentPane().setBackground(new Color(135, 206, 235));
		getContentPane().setLayout(null);
		

		panel.setBackground(new Color(173, 216, 230));
		panel.setBounds(23, 6, 788, 559);
		getContentPane().add(panel);
		panel.setLayout(null);
		
		
		menuBar.setBounds(10, 0, 543, 21);
		panel.add(menuBar);
		
		
		menuBar.add(mnConexion);
		mntmConectarse.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				if(evt.getSource()==mntmConectarse){
					
					FrameLogin panelLogin=new FrameLogin();
					panel.remove(panel_1);
					panel.add(panelLogin);
					panel.revalidate();
				
					
					}	
			}
		});
		
		
		mnConexion.add(mntmConectarse);
		
		
		menuBar.add(mnFacturacion);
		

		menuBar.add(mnInformes);
		
	
		separator.setBounds(547, 33, 17, 506);
		separator.setOrientation(SwingConstants.VERTICAL);
		panel.add(separator);
		
	
		
		panel2.setBounds(10, 33, 525, 506);
		panel2.setBackground(Color.WHITE);
		
		
		
		panel.add(panel2);
		panel2.setLayout(null);
		
		
		scrollPane_1.setBounds(0, 0, 519, 500);
		panel2.add(scrollPane_1);
		
		
		panel_2.setBounds(565, 6, 173, 529);
		panel_2.setBackground(Color.WHITE);
		panel.add(panel_2);

		label.setBounds(5, 5, 20, 20);
		panel_2.add(label);
		label.setPreferredSize(new java.awt.Dimension(97, 101));
	}

	@Override
	public void actionPerformed(ActionEvent evt) {
		if(evt.getSource()==mntmConectarse){
			
				FrameLogin panelLogin=new FrameLogin();
				panel.remove(panel_1);
				panel.add(panelLogin);
			
				
				}	
	}
}
